<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <body>
        <ui:composition template="./UserTemplate.xhtml">
            <ui:define name="content">
                <p:panel header="MOVIES AND DRAMA EVENTS">

                    <p:dataTable value="#{UsereventBean.listByCat('Film')}" var="item"
                                 paginator="true" rows="5"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 rowsPerPageTemplate="5,10,15">
                        <p:column>
                            <f:facet name="header">
                            </f:facet>
                            <h:commandLink action="ViewDetails" >
                                <p:graphicImage width="180" height="269" value="#{item.eventImg}"/>
                                <f:setPropertyActionListener value="#{item}" target="#{UsereventBean.selectev}" />
                            </h:commandLink>

                        </p:column>
                        <p:column>
                            <f:facet name="header">
                            </f:facet>
                            <h:commandLink value="#{item.eventTitle}" style="color: red" action="ViewDetails">
                                <f:setPropertyActionListener value="#{item}" target="#{UsereventBean.selectev}" />
                            </h:commandLink><br/>
                            <h:outputText value="From: "/>
                            <h:outputText style="color: blueviolet" value="#{item.releaseDate}">
                                <f:convertDateTime pattern="dd/MM/yyyy"/>
                            </h:outputText>
                            <h:outputText value=" to "/>
                            <h:outputText style="color: blueviolet" value="#{item.endDate}">
                                <f:convertDateTime pattern="dd/MM/yyyy"/>
                            </h:outputText><br/>
                            <h:outputText value="Duration: #{item.duration} hour(s)"/><br/>
                            <h:outputText value="#{item.eventInfo}"/><br/>

                        </p:column>
                        <p:column>
                            <p:graphicImage value="../resources/images/shared/house_rule_1.png" title="Do not bring cameras and recorder to the theatre"/><br/>
                            <br/><br/><br/><br/><br/>
                             <h:commandLink action="Tickets" title="Buy tickets">
                                <p:graphicImage value="../resources/images/shared/get_a_ticket.png"/>
                                <f:setPropertyActionListener value="#{item}" target="#{UsereventBean.event}"/>
                            </h:commandLink>
                        </p:column>

                    </p:dataTable>

                </p:panel>

            </ui:define>
        </ui:composition>

    </body>
</html>
